import {
    BoxGeometry,
    Mesh,
    MeshLambertMaterial,
    PlaneGeometry,
    SphereGeometry,
    TextureLoader
} from 'three'

// const geometry = new PlaneGeometry(100,100)
// const geometry = new SphereGeometry(100)
const geometry = new BoxGeometry(100,100,100)

// 创建一个纹理加载器
const loadTex = new TextureLoader();
// 通过纹理加载器加载图片返回一个对象
const texture = loadTex.load('/static/images/code.png')
console.log(texture)

const materil = new MeshLambertMaterial({
    color:0x00ffff,
    map:texture  //将纹理贴到材质上
})

// // 也可以通过次方法进行设置
// materil.map = texture

const mesh = new Mesh(geometry,materil)
export default mesh